home *** CD-ROM | disk | FTP | other *** search
/ Internet.Works 39 / Issue 39.iso / mac / MacSoftware / Netscape 6 Full Installer / Installer Modules / browser.xpi / viewer / chrome / toolkit.jar / content / global / xulBindings.xml < prev   
Encoding:
Extensible Markup Language  |  2000-09-29  |  30.6 KB  |  721 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings id="xulBindings"
  4.    xmlns="http://www.mozilla.org/xbl"
  5.    xmlns:html="http://www.w3.org/1999/xhtml"
  6.    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  7.   
  8.   <binding id="thumb" extends="xul:box">
  9.     <content>
  10.       <xul:spring flex="1"/>
  11.           <xul:image inherits="src"/>
  12.           <xul:spring flex="1"/>
  13.     </content>
  14.   </binding>
  15.  
  16.   <binding id="scrollbar">
  17.     <content>
  18.       <xul:scrollbarbutton type="decrement">
  19.           <xul:image inherits="src"/>
  20.         </xul:scrollbarbutton>
  21.       <xul:slider flex="1" inherits="curpos,maxpos,pageincrement,increment">
  22.           <xul:thumb inherits="align,src" flex="1"/>
  23.       </xul:slider>
  24.       <xul:scrollbarbutton type="increment">
  25.         <xul:image inherits="src"/>
  26.       </xul:scrollbarbutton>
  27.     </content>
  28.   </binding>
  29.  
  30.   <binding id="slider">
  31.     <content>
  32.       <xul:button align="horizontal"/>
  33.     </content>
  34.   </binding>
  35.  
  36.   <binding id="tab">
  37.     <content>
  38.       <xul:image inherits="src" class="tab-left"/>
  39.       <xul:text flex="1" inherits="value,crop,accesskey" crop="right" class="tab-text"/>
  40.     </content>
  41.   </binding>
  42.  
  43.  
  44.   <binding id="menu-menubar">
  45.     <content includes="menupopup">
  46.       <xul:text class="menubar-text" inherits="value,accesskey,crop" crop="right"/>
  47.     </content>
  48.   </binding>
  49.  
  50.   <binding id="menu-menubar-iconic">
  51.     <content includes="menupopup">
  52.       <xul:image class="menubar-left"/>
  53.       <xul:text class="menubar-text" inherits="value,accesskey,crop" crop="right"/>
  54.     </content>
  55.   </binding>
  56.  
  57.   <binding id="menu">
  58.     <content autostretch="never" includes="menupopup">
  59.       <xul:text class="menu-text" flex="1" align="left" inherits="value,accesskey,crop" crop="right"/>
  60.       <xul:text class="menu-accel" inherits="acceltext:value"/>
  61.       <xul:box autostretch="never" class="menu-right" inherits="menuactive,disabled">
  62.         <xul:image/>
  63.       </xul:box>
  64.     </content>
  65.     <implementation>
  66.       <property name="data" onset="this.setAttribute('data',val); return val;"
  67.                             onget="return this.getAttribute('data');"/>
  68.     </implementation>  
  69.   </binding>
  70.  
  71.   <binding id="menuitem">
  72.     <content autostretch="never" includes="menupopup">
  73.       <xul:text class="menu-text" flex="1" align="left" inherits="value,accesskey,crop" crop="right"/>
  74.       <xul:text class="menu-accel" inherits="value=acceltext"/>
  75.     </content>
  76.     <implementation>
  77.       <property name="data" onset="this.setAttribute('data',val); return val;"
  78.                             onget="return this.getAttribute('data');"/>
  79.     </implementation>  
  80.   </binding>
  81.  
  82.   <binding id="menuitem-iconic">
  83.     <content includes="menupopup">
  84.       <xul:box class="menu-iconic-left" orient="vertical" autostretch="never" inherits="selected,menuactive,disabled,checked">
  85.         <xul:image/>
  86.       </xul:box>
  87.       <xul:text class="menu-iconic-text" flex="1" align="left" inherits="value,accesskey,crop" crop="right"/>
  88.       <xul:text class="menu-iconic-accel" inherits="value=acceltext"/>
  89.     </content>
  90.     <implementation>
  91.       <property name="data" onset="this.setAttribute('data',val); return val;"
  92.                             onget="return this.getAttribute('data');"/>
  93.     </implementation>  
  94.   </binding>
  95.  
  96.   <binding id="menu-iconic">
  97.     <content autostretch="never" includes="menupopup">
  98.       <xul:box class="menu-iconic-left" orient="vertical" autostretch="never">
  99.         <xul:image/>
  100.       </xul:box>
  101.       <xul:text class="menu-iconic-text" flex="1" align="left" inherits="value,accesskey,crop" crop="right"/>
  102.       <xul:text class="menu-iconic-accel" inherits="value=acceltext"/>
  103.       <xul:box orient="vertical" autostretch="never" class="menu-right" inherits="menuactive,disabled">
  104.         <xul:image/>
  105.       </xul:box>
  106.     </content>
  107.     <implementation>
  108.       <property name="data" onset="this.setAttribute('data',val); return val;"
  109.                             onget="return this.getAttribute('data');"/>
  110.     </implementation>  
  111.   </binding>
  112.   
  113.   <binding id="basetext">
  114.     <implementation>
  115.       <!-- public implementation -->
  116.       <property name="value"      onset="return this.setAttribute('value',val);"
  117.                                   onget="return this.getAttribute('value');"/>
  118.       <property name="crop"       onset="return this.setAttribute('crop',val);"
  119.                                   onget="return this.getAttribute('crop');"/>
  120.       <property name="disabled"   onset="if (val) this.setAttribute('disabled', 'true');
  121.                                          else this.removeAttribute('disabled');
  122.                                          return val;"
  123.                                   onget="var v = this.getAttribute('disabled');
  124.                                          if (v == 'true') return true; return false;"/>                                  
  125.       <property name="src"        onset="return this.setAttribute('src',val);"
  126.                                   onget="return this.getAttribute('src');"/>
  127.       <property name="accesskey"  onset="return this.setAttribute('accesskey',val);"
  128.                                   onget="return this.getAttribute('accesskey');"/>
  129.       <property name="imgalign"   onset="return this.setAttribute('imgalign',val);"
  130.                                   onget="return this.getAttribute('imgalign');"/>
  131.     </implementation>      
  132.   </binding>
  133.   
  134.   <binding id="checkbox" extends="chrome://global/content/xulBindings.xml#basetext">
  135.     <content>
  136.       <xul:box flex="1" class="internal-box" autostretch="never" valign="top">
  137.         <xul:box class="checkmark-box" autostretch="never">
  138.           <xul:image class="checkbox-check"/>
  139.         </xul:box>
  140.         <xul:image class="checkbox-icon" inherits="src"/>
  141.         <xul:html inherits="value,accesskey,crop" flex="1">
  142.           <children/>
  143.         </xul:html>
  144.       </xul:box>
  145.     </content>
  146.     <implementation>
  147.       <!-- public implementation -->
  148.       <property name="checked"    onset="if (val) this.setAttribute('checked', 'true');
  149.                                          else this.removeAttribute('checked');
  150.                                          return val;"
  151.                                   onget="var v = this.getAttribute('checked');
  152.                                          if (v == 'true') return true; return false;"/>
  153.     </implementation>
  154.     <handlers>
  155.       <handler event="click">
  156.       <![CDATA[
  157.         if (!this.disabled) this.checked = !this.checked; 
  158.       ]]>
  159.       </handler>
  160.       <handler event="keypress" key=" " action="if (!this.disabled) this.checked = !this.checked;"/>
  161.     </handlers>
  162.   </binding>
  163.  
  164.   <!-- XUL <button>s -->
  165.   <binding id="buttonleft" extends="chrome://global/content/xulBindings.xml#basetext">
  166.     <content>
  167.         <xul:box class="button-internal-box" autostretch="never" flex="1">
  168.         <xul:image class="button-icon" inherits="src"/>
  169.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  170.           <xul:text class="button-text" inherits="value,accesskey,crop,dragover-top"/>
  171.         </xul:box>
  172.       </xul:box>
  173.     </content>
  174.   </binding>
  175.  
  176.   <binding id="buttontop" extends="chrome://global/content/xulBindings.xml#basetext">
  177.     <content>
  178.         <xul:box class="button-internal-box" orient="vertical" autostretch="never" flex="1">
  179.         <xul:image class="button-icon" inherits="src"/>
  180.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  181.           <xul:text class="button-text" inherits="value,accesskey,crop,dragover-top"/>
  182.         </xul:box>
  183.       </xul:box>
  184.     </content>
  185.   </binding>
  186.   
  187.   <binding id="buttonright" extends="chrome://global/content/xulBindings.xml#basetext">
  188.     <content>
  189.         <xul:box class="button-internal-box" inherits="orient" autostretch="never" flex="1">
  190.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  191.           <xul:text class="button-text" inherits="value,accesskey,crop,dragover-top"/>
  192.         </xul:box>
  193.         <xul:image class="button-icon" inherits="src"/>
  194.       </xul:box>
  195.     </content>
  196.   </binding>
  197.  
  198.   <binding id="buttonbottom" extends="chrome://global/content/xulBindings.xml#basetext">
  199.     <content>
  200.         <xul:box class="button-internal-box" orient="vertical" autostretch="never" flex="1">
  201.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  202.           <xul:text class="button-text" inherits="value,accesskey,crop,dragover-top"/>
  203.         </xul:box>
  204.         <xul:image class="button-icon" inherits="src"/>
  205.       </xul:box>
  206.     </content>
  207.   </binding>
  208.   
  209.   <binding id="separator" extends="xul:spring"/>
  210.  
  211.   <!-- appending to the end so we don't make hyatt cry -->
  212.   <binding id="progressmeter" extends="xul:box">
  213.     <content>
  214.       <xul:box class="progressmeter-internal-box" flex="1">
  215.         <xul:stack class="progressmeter-stack" flex="1">
  216.           <xul:progressbar class="progressmeter-progressbar" inherits="value,statusbar">
  217.             <xul:box class="progress-bar"/>
  218.             <xul:box class="progress-remainder"/>
  219.           </xul:progressbar>
  220.           <xul:box>
  221.             <xul:spring flex="1"/>
  222.             <xul:text class="progress-text" inherits="progresstext:value"/>
  223.             <xul:spring flex="1"/>
  224.           </xul:box>
  225.         </xul:stack>
  226.       </xul:box>
  227.     </content>
  228.     <implementation>
  229.       <property name="progresstext"   onset="this.setAttribute('progresstext',val); return val;"
  230.                                       onget="return this.getAttribute('progresstext');"/>
  231.       <property name="value"          onset="this.setAttribute('value',val); return val;"
  232.                                       onget="return this.getAttribute('value');"/>
  233.       <property name="mode"           onset="this.setAttribute('mode', val); return val;"
  234.                                       onget="return this.getAttribute('mode');"/>
  235.     </implementation>
  236.   </binding>
  237.  
  238.   <binding id="textfield" extends="xul:box">
  239.     <content>
  240.       <xul:box class="textfield-internal-box" flex="1">
  241.         <html:input class="textfield-input" flex="1" inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly"/>
  242.       </xul:box>
  243.     </content>
  244.     <implementation>
  245.       <property name="inputField" readonly="true">
  246.        <![CDATA[
  247.         var v = document.getAnonymousNodes(this);
  248.         var input = null;
  249.         for (var i = 0; i < v.length; i++) {
  250.           try {
  251.             var l = v[i].getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "input");
  252.             if (l.length > 0) {
  253.               input = l[0];
  254.               break;
  255.             }
  256.           } catch (e) {} 
  257.         }
  258.         input;
  259.       ]]>
  260.       </property>
  261.       <property name="value"      onset="this.inputField.value = val; return val;"
  262.                                   onget="return this.inputField.value;"/>
  263.       <property name="type"       onset="this.inputField.type = val; return val;"
  264.                                   onget="return this.inputField.type;"/>
  265.       <property name="maxlength"  onset="this.inputField.maxlength = val; return val;"
  266.                                   onget="return this.inputField.maxlength;"/>
  267.       <property name="disabled"   onset="this.inputField.disabled = val; return val;"
  268.                                   onget="return this.inputField.disabled;"/>
  269.       <property name="size"       onset="this.inputField.size = val; return val;"
  270.                                   onget="return this.inputField.size;"/>
  271.       <property name="readonly"   onset="this.inputField.readonly = val; return val;"
  272.                                   onget="return this.inputField.readonly;"/>
  273.  
  274.       <method name="select">
  275.         <body>
  276.           this.inputField.select();
  277.         </body>
  278.       </method>
  279.       
  280.       <property name="controllers"    readonly="true" onget="return this.inputField.controllers"/>
  281.       <property name="textLength"     readonly="true" onget="return this.inputField.textLength;"/>
  282.       <property name="selectionStart" onset="this.inputField.selectionStart = val; return val;"
  283.                                       onget="return this.inputField.selectionStart;"/>
  284.       <property name="selectionEnd"   onset="this.inputField.selectionEnd = val; return val;"
  285.                                       onget="return this.inputField.selectionEnd;"/>
  286.      
  287.       <property name="suppressFocusBlur">
  288.         false
  289.       </property>
  290.  
  291.       <method name="setSelectionRange">
  292.         <parameter name="aSelectionStart"/>
  293.         <parameter name="aSelectionEnd"/>
  294.         <body>
  295.           this.inputField.setSelectionRange( aSelectionStart, aSelectionEnd );
  296.         </body>
  297.       </method>
  298.  
  299.     </implementation>
  300.     <handlers>
  301.       <handler event="focus" phase="capturing">
  302.       <![CDATA[
  303.         if (this.getAttribute('focused') != 'true') {
  304.           this.setAttribute('focused','true');
  305.           this.suppressFocusBlur = true;
  306.           if (document.commandDispatcher.focusedElement != this.inputField) 
  307.             this.inputField.focus();
  308.           this.suppressFocusBlur = false;
  309.         }
  310.       ]]>
  311.       </handler>
  312.       <handler event="blur" phase="capturing">
  313.       <![CDATA[
  314.         if (!this.suppressFocusBlur && this.getAttribute('focused') == 'true') {
  315.           this.removeAttribute('focused');
  316.         }
  317.       ]]>
  318.       </handler>
  319.    </handlers>    
  320.   </binding>
  321.  
  322.   <binding id="textarea" extends="chrome://global/content/xulBindings.xml#textfield">
  323.     <content>
  324.       <xul:box class="textarea-internal-box" flex="1">
  325.         <html:textarea class="textfield-textarea" flex="1" inherits="onfocus,onblur,value,disabled,rows,cols,readonly"/>
  326.       </xul:box>
  327.     </content>
  328.     <implementation>
  329.       <property name="inputField" readonly="true">
  330.        <![CDATA[
  331.         var v = document.getAnonymousNodes(this);
  332.         var input = null;
  333.         for (var i = 0; i < v.length; i++) {
  334.           try {
  335.             var l = v[i].getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "textarea");
  336.             if (l.length > 0) {
  337.               input = l[0];
  338.               break;
  339.             }
  340.           } catch (e) {} 
  341.         }
  342.         input;
  343.       ]]>
  344.       </property>
  345.     </implementation>
  346.   </binding>
  347.  
  348.   <binding id="text-label">
  349.     <handlers>
  350.       <handler event="click" action="var forElementID = this.getAttribute('for'); if(forElementID) var forElement = document.getElementById(forElementID); if(forElement) forElement.focus();"/>
  351.     </handlers>
  352.   </binding>
  353.   
  354.   <binding id="text-editable-display" extends="chrome://global/content/xulBindings.xml#text"/>
  355.   
  356.   <binding id="text-editable-edit" extends="xul:box">
  357.     <content>
  358.       <xul:box flex="1">
  359.         <html:input type="text" inherits="value,type,maxlength,disabled,size,readonly"/>
  360.       </xul:box>
  361.     </content>
  362.     <handlers>
  363.       <handler event="blur" action="this.setAttribute('mode','display');"/>
  364.     </handlers>
  365.   </binding>
  366.  
  367.   <binding id="tooltips" extends="chrome://global/content/xulBindings.xml#popups">
  368.     <content>
  369.       <xul:box class="popup-internal-box" orient="vertical" flex="1">
  370.         <children/>
  371.       </xul:box>
  372.     </content>
  373.   </binding>
  374.  
  375.   <binding id="popups">
  376.     <content>
  377.       <!--xul:box class="popup-internal-box" orient="vertical" flex="1" style="overflow: auto">
  378.         <children/>
  379.       </xul:box-->
  380.  
  381.       <xul:arrowscrollbox class="popup-internal-box" flex="1" orient="vertical">
  382.           <!--xul:box class="popup-internal-box" orient="vertical"-->
  383.             <children/>
  384.           <!--/xul:box-->
  385.       </xul:arrowscrollbox>
  386.  
  387.     </content>
  388.     <implementation>
  389.       <method name="openPopup">
  390.         <parameter name="element"/>
  391.         <parameter name="xpos"/>
  392.         <parameter name="ypos"/>
  393.         <parameter name="popuptype"/>
  394.         <parameter name="anchoralignment"/>
  395.         <parameter name="popupalignment"/>
  396.         <body>
  397.         <![CDATA[
  398.           try {
  399.             var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  400.             var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  401.           } catch(e) {}
  402.           if (popupSetBox)
  403.             popupSetBox.createPopup(element, this, xpos, ypos, popuptype, anchoralignment, popupalignment);
  404.           else if (menuBox)
  405.             menuBox.openMenu(true);
  406.         ]]>
  407.         </body>
  408.       </method>
  409.       <method name="closePopup">
  410.         <body>
  411.         <![CDATA[
  412.           try {
  413.             var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  414.             var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  415.           } catch(e) {}
  416.           if (popupSetBox)
  417.             popupSetBox.destroyPopup();
  418.           else if (menuBox)
  419.             menuBox.openMenu(false);
  420.         ]]>
  421.         </body>
  422.       </method>
  423.       <property name="activeChild">
  424.         <getter>
  425.           <![CDATA[
  426.             try {
  427.               var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  428.               var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  429.             } catch(e) {}
  430.             if (popupSetBox)
  431.               return popupSetBox.activeChild;
  432.             else if (menuBox)
  433.               return menuBox.activeChild;
  434.           ]]>
  435.         </getter>
  436.         <setter>
  437.           <![CDATA[
  438.             try {
  439.               var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  440.               var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  441.             } catch(e) {}
  442.             if (popupSetBox)
  443.               return popupSetBox.activeChild = val;
  444.             else if (menuBox)
  445.               return menuBox.activeChild = val;
  446.           ]]>
  447.         </setter>
  448.       </property>
  449.     </implementation>     
  450.   </binding>
  451.   
  452.   <binding id="colorpicker" extends="xul:box">
  453.     <implementation>
  454.       <property name="color" onset="return this.setAttribute('color', val);"
  455.                              onget="return this.getAttribute('color');"/>
  456.       <property name="selectedItem"/>
  457.     </implementation>
  458.     <content>
  459.  
  460.       <xul:box flex="1" orient="vertical" onclick="parentNode.color = event.target.getAttribute('color');
  461.                                                    try { parentNode.selectedItem.removeAttribute('selected'); } catch(e) { }
  462.                                                    parentNode.selectedItem = event.target;
  463.                                                    event.target.setAttribute('selected', 'true');">
  464.  
  465.       <xul:box align="horizontal">
  466.         <xul:spring class="colorpickertile" style="background-color: #FFFFFF" color="#FFFFFF"/>
  467.         <xul:spring class="colorpickertile" style="background-color: #FFCCCC" color="#FFCCCC"/>
  468.         <xul:spring class="colorpickertile" style="background-color: #FFCC99" color="#FFCC99"/>
  469.         <xul:spring class="colorpickertile" style="background-color: #FFFF99" color="#FFFF99"/>
  470.         <xul:spring class="colorpickertile" style="background-color: #FFFFCC" color="#FFFFCC"/>
  471.         <xul:spring class="colorpickertile" style="background-color: #99FF99" color="#99FF99"/>
  472.         <xul:spring class="colorpickertile" style="background-color: #99FFFF" color="#99FFFF"/>
  473.         <xul:spring class="colorpickertile" style="background-color: #CCFFFF" color="#CCFFFF"/>
  474.         <xul:spring class="colorpickertile" style="background-color: #CCCCFF" color="#CCCCFF"/>
  475.         <xul:spring class="colorpickertile" style="background-color: #FFCCFF" color="#FFCCFF"/>
  476.       </xul:box>
  477.       <xul:box align="horizontal">
  478.         <xul:spring class="colorpickertile" style="background-color: #CCCCCC" color="#CCCCCC"/>
  479.         <xul:spring class="colorpickertile" style="background-color: #FF6666" color="#FF6666"/>
  480.         <xul:spring class="colorpickertile" style="background-color: #FFCC33" color="#FFCC33"/>
  481.         <xul:spring class="colorpickertile" style="background-color: #FFFF66" color="#FFFF66"/>
  482.         <xul:spring class="colorpickertile" style="background-color: #FFFF99" color="#FFFF99"/>
  483.         <xul:spring class="colorpickertile" style="background-color: #66FF99" color="#66FF99"/>
  484.         <xul:spring class="colorpickertile" style="background-color: #33FFFF" color="#33FFFF"/>
  485.         <xul:spring class="colorpickertile" style="background-color: #66FFFF" color="#66FFFF"/>
  486.         <xul:spring class="colorpickertile" style="background-color: #9999FF" color="#9999FF"/>
  487.         <xul:spring class="colorpickertile" style="background-color: #FF99FF" color="#FF99FF"/>
  488.       </xul:box>
  489.       <xul:box align="horizontal">
  490.         <xul:spring class="colorpickertile" style="background-color: #C0C0C0" color="#C0C0C0"/>
  491.         <xul:spring class="colorpickertile" style="background-color: #FF0000" color="#FF0000"/>
  492.         <xul:spring class="colorpickertile" style="background-color: #FF9900" color="#FF9900"/>
  493.         <xul:spring class="colorpickertile" style="background-color: #FFCC66" color="#FFCC66"/>
  494.         <xul:spring class="colorpickertile" style="background-color: #FFFF00" color="#FFFF00"/>
  495.         <xul:spring class="colorpickertile" style="background-color: #33FF33" color="#33FF33"/>
  496.         <xul:spring class="colorpickertile" style="background-color: #66CCCC" color="#66CCCC"/>
  497.         <xul:spring class="colorpickertile" style="background-color: #33CCFF" color="#33CCFF"/>
  498.         <xul:spring class="colorpickertile" style="background-color: #6666CC" color="#6666CC"/>
  499.         <xul:spring class="colorpickertile" style="background-color: #CC66CC" color="#CC66CC"/>
  500.       </xul:box>
  501.       <xul:box align="horizontal">
  502.         <xul:spring class="colorpickertile" style="background-color: #999999" color="#999999"/>
  503.         <xul:spring class="colorpickertile" style="background-color: #CC0000" color="#CC0000"/>
  504.         <xul:spring class="colorpickertile" style="background-color: #FF6600" color="#FF6600"/>
  505.         <xul:spring class="colorpickertile" style="background-color: #FFCC33" color="#FFCC33"/>
  506.         <xul:spring class="colorpickertile" style="background-color: #FFCC00" color="#FFCC00"/>
  507.         <xul:spring class="colorpickertile" style="background-color: #33CC00" color="#33CC00"/>
  508.         <xul:spring class="colorpickertile" style="background-color: #00CCCC" color="#00CCCC"/>
  509.         <xul:spring class="colorpickertile" style="background-color: #3366FF" color="#3366FF"/>
  510.         <xul:spring class="colorpickertile" style="background-color: #6633FF" color="#6633FF"/>
  511.         <xul:spring class="colorpickertile" style="background-color: #CC33CC" color="#CC33CC"/>
  512.       </xul:box>
  513.       <xul:box align="horizontal">
  514.         <xul:spring class="colorpickertile" style="background-color: #666666" color="#666666"/>
  515.         <xul:spring class="colorpickertile" style="background-color: #990000" color="#990000"/>
  516.         <xul:spring class="colorpickertile" style="background-color: #CC6600" color="#CC6600"/>
  517.         <xul:spring class="colorpickertile" style="background-color: #CC9933" color="#CC9933"/>
  518.         <xul:spring class="colorpickertile" style="background-color: #999900" color="#999900"/>
  519.         <xul:spring class="colorpickertile" style="background-color: #009900" color="#009900"/>
  520.         <xul:spring class="colorpickertile" style="background-color: #339999" color="#339999"/>
  521.         <xul:spring class="colorpickertile" style="background-color: #3333FF" color="#3333FF"/>
  522.         <xul:spring class="colorpickertile" style="background-color: #6600CC" color="#6600CC"/>
  523.         <xul:spring class="colorpickertile" style="background-color: #993399" color="#993399"/>
  524.       </xul:box>
  525.       <xul:box align="horizontal">
  526.         <xul:spring class="colorpickertile" style="background-color: #333333" color="#333333"/>
  527.         <xul:spring class="colorpickertile" style="background-color: #660000" color="#660000"/>
  528.         <xul:spring class="colorpickertile" style="background-color: #993300" color="#993300"/>
  529.         <xul:spring class="colorpickertile" style="background-color: #996633" color="#996633"/>
  530.         <xul:spring class="colorpickertile" style="background-color: #666600" color="#666600"/>
  531.         <xul:spring class="colorpickertile" style="background-color: #006600" color="#006600"/>
  532.         <xul:spring class="colorpickertile" style="background-color: #336666" color="#336666"/>
  533.         <xul:spring class="colorpickertile" style="background-color: #000099" color="#000099"/>
  534.         <xul:spring class="colorpickertile" style="background-color: #333399" color="#333399"/>
  535.         <xul:spring class="colorpickertile" style="background-color: #663366" color="#663366"/>
  536.       </xul:box>
  537.       <xul:box align="horizontal">
  538.         <xul:spring class="colorpickertile" style="background-color: #000000" color="#000000"/>
  539.         <xul:spring class="colorpickertile" style="background-color: #330000" color="#330000"/>
  540.         <xul:spring class="colorpickertile" style="background-color: #663300" color="#663300"/>
  541.         <xul:spring class="colorpickertile" style="background-color: #663333" color="#663333"/>
  542.         <xul:spring class="colorpickertile" style="background-color: #333300" color="#333300"/>
  543.         <xul:spring class="colorpickertile" style="background-color: #003300" color="#003300"/>
  544.         <xul:spring class="colorpickertile" style="background-color: #003333" color="#003333"/>
  545.         <xul:spring class="colorpickertile" style="background-color: #000066" color="#000066"/>
  546.         <xul:spring class="colorpickertile" style="background-color: #330099" color="#330099"/>
  547.         <xul:spring class="colorpickertile" style="background-color: #330033" color="#330033"/>
  548.       </xul:box>
  549.       </xul:box>
  550.     </content>
  551.   </binding>
  552.  
  553.  <!-- NOTE: this should really extend menu, but doing this causes the menupopup to be ignored (bug) -->
  554.   <binding id="colorpickerButton" extends="xul:box">
  555.     <content>
  556.       <xul:menu class="colorpicker-button-menu" allowevents="true">
  557.         <xul:box class="colorpicker-button-colorbox"/>
  558.         <xul:menupopup class="colorpicker-button-menupopup"
  559.           oncreate="this.parentNode.parentNode.setAttribute('menuactive', 'true')"
  560.           ondestroy="this.parentNode.parentNode.setAttribute('menuactive', 'false')">
  561.           <xul:colorpicker inherits="palettename" allowevents="true"
  562.            onclick="this.parentNode.parentNode.parentNode.pickerClicked(event)"/>
  563.         </xul:menupopup>
  564.       </xul:menu>
  565.     </content>
  566.     
  567.     <implementation>
  568.       <property name="onchange"/>
  569.       
  570.       <property name="color">
  571.         <getter>
  572.           return this.getAttribute("color");
  573.         </getter>
  574.         <setter>
  575.           this.mColorBox.setAttribute("style", "background-color: " + val);
  576.           return this.setAttribute("color", val);
  577.         </setter>
  578.       </property>
  579.       <method name="initialize">
  580.         <body><![CDATA[
  581.           var change = this.getAttribute("onchange");
  582.           if (change) this.onchange = new Function("event", change);
  583.           
  584.           var menu = document.getAnonymousNodes(this)[0];
  585.           this.mPicker = menu.childNodes[1].childNodes[0];
  586.           this.mColorBox = menu.childNodes[0];
  587.         ]]></body>
  588.       </method>
  589.       <method name="pickerClicked">
  590.         <parameter name="aEvent"/>
  591.         <body><![CDATA[
  592.           this.color = this.mPicker.color;
  593.           this.mPicker.parentNode.closePopup();
  594.           if (this.onchange) this.onchange(aEvent);
  595.         ]]></body>
  596.       </method>
  597.     </implementation>
  598.     <handlers>
  599.       <handler event="bindingattached">this.initialize()</handler>
  600.     </handlers>
  601.   </binding>
  602.   
  603.   <!-- XUL <statusbar> -->
  604.   <binding id="statusbar" extends="xul:box"/>
  605.     
  606.   <binding id="statusbar-panel" extends="xul:button">
  607.     <content autostretch="never" valign="middle">
  608.       <xul:image class="statusbar-panel-icon" inherits="src"/>
  609.       <xul:text class="statusbar-panel-text" inherits="value,crop" crop="right" flex="1"/>
  610.     </content>
  611.     <implementation>
  612.       <property name="value"
  613.                 onget="return this.getAttribute('value');"
  614.                 onset="this.setAttribute('value',val); return val;"/>
  615.       <property name="src"
  616.                 onget="return this.getAttribute('src');"
  617.                 onset="this.setAttribute('src',val); return val;"/>
  618.     </implementation>
  619.   </binding>
  620.   
  621.   <binding id="browser">
  622.     <implementation>
  623.       <property name="webBrowser"
  624.                 readonly="true"
  625.                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).webBrowser"/>
  626.     </implementation>
  627.   </binding>
  628.  
  629.   <binding id="editor">
  630.     <implementation>
  631.       <property name="editorShell"
  632.                 readonly="true"
  633.                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIEditorBoxObject).editorShell"/>
  634.     </implementation>
  635.   </binding>
  636.  
  637.   <binding id="iframe">
  638.     <implementation>
  639.       <property name="docShell"
  640.                 readonly="true"
  641.                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIIFrameBoxObject).docShell"/>
  642.     </implementation>
  643.   </binding>
  644.  
  645.   <binding id="titledbox">
  646.     <content>
  647.       <xul:box class="titledbox-title" autostretch="never" orient="vertical">
  648.         <children includes="title"/>
  649.       </xul:box>
  650.       <xul:box flex="1" class="titledbox-body" inherits="orient,autostretch,align,valign">
  651.         <children/>
  652.       </xul:box>
  653.     </content>    
  654.   </binding>
  655.   
  656.   <binding id="titledboxvalue">
  657.     <content>
  658.       <xul:box class="titledbox-title" autostretch="never" orient="vertical">
  659.         <xul:title inherits="value"/>
  660.       </xul:box>
  661.       <xul:box flex="1" class="titledbox-body" inherits="orient,autostretch,align,valign">
  662.         <children/>
  663.       </xul:box>
  664.     </content>    
  665.   </binding>
  666.   
  667.   <binding id="title">
  668.     <content>
  669.       <xul:text inherits="value"/>
  670.     </content>
  671.   </binding>
  672.  
  673.   <binding id="autorepeatbutton-up">
  674.      <content>
  675.         <xul:image class="autorepeatbutton-up"/>
  676.      </content>
  677.   </binding>
  678.  
  679.   <binding id="autorepeatbutton-down">
  680.      <content>
  681.         <xul:image class="autorepeatbutton-down"/>
  682.      </content>
  683.   </binding>
  684.  
  685.   <binding id="scrollbox">
  686.     <content>
  687.       <xul:box class="scrollbox-innerbox" inherits="orient,autostretch,align,valign">
  688.         <children/>
  689.       </xul:box>
  690.     </content>
  691.   </binding>
  692.  
  693.   <binding id="arrowscrollbox" extends="xul:stack">
  694.     <content>
  695.       <xul:vbox 
  696.       onunderflow="
  697.           var button1 = this.firstChild;
  698.           var button2 = this.childNodes[2];
  699.            button1.setAttribute('collapsed', 'true');
  700.           button2.setAttribute('collapsed', 'true');
  701.       " 
  702.       onoverflow="
  703.           var button1 = this.firstChild;
  704.           var button2 = this.childNodes[2];
  705.            button1.removeAttribute('collapsed');
  706.           button2.removeAttribute('collapsed');
  707.       ">
  708.       <xul:autorepeatbutton autostretch="never" class="up" collapsed="true" 
  709.           oncommand="parentNode.childNodes[1].boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject).scrollByIndex(-1);"/>
  710.       <xul:scrollbox orient="vertical" flex="1">
  711.          <children/>
  712.       </xul:scrollbox>
  713.       <xul:autorepeatbutton autostretch="never" class="down" collapsed="true" 
  714.           oncommand="parentNode.childNodes[1].boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject).scrollByIndex(1);"/>
  715.       </xul:vbox>
  716.     </content>
  717.   </binding>
  718.  
  719. </bindings>
  720.  
  721.